package cn.com.wms.Base.pageInfo;

import java.io.Serializable;

public class PagingBean implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -1431872118906571066L;
	
	//每页显示数据行数
	private int showRow = 10;
	
	//总页数
	private int allPage = 1;
	
	//总记录数
	private int allRows = 0;
	
	//当前页
	private int indexPage = 1;
	
	/**
	 * 当前页首先记录
	 */
	private int beginRecord;
	
	/**
	 * 当前页结束记录
	 */
	private int endRecord;

	public int getShowRow() {
		return showRow;
	}

	public void setShowRow(int showRow) {
		this.showRow = showRow;
	}

	public int getAllPage() {
		return allPage;
	}

	public void setAllPage(int allPage) {
		this.allPage=allPage;
	}

	public int getAllRows() {
		return allRows;
	}

	public void setAllRows(int allRows) {
		this.allRows = allRows;
		/*add by zbzhu*/
		if((int)Math.ceil((double)this.allRows / this.showRow)==0){
			this.allPage=1;
		}else{
			this.allPage=(int)Math.ceil((double)this.allRows / this.showRow);
		}
	}

	public int getIndexPage() {
		return indexPage;
	}

	public void setIndexPage(int indexPage) {
		this.indexPage = indexPage;
	}

	public int getBeginRecord() {
		return (getIndexPage()-1)*showRow+1;
	}

	public void setBeginRecord(int beginRecord) {
		this.beginRecord = beginRecord;
	}

	public int getEndRecord() {
		return getBeginRecord()+showRow-1;
	}

	public void setEndRecord(int endRecord) {
		this.endRecord = endRecord;
	}

}
